class Alg<T extends Comparable<T>>{
    public T FindMax(T[] array){
        T max=array[0];
        for (int i = 0; i < array.length; i++) {
            if(array[i].compareTo(max)>0){
                max=array[i];
            }
        }
        return max;
    }
}
public class T2 {
//    写一个泛型类 求出数组中最大值
    public static void main(String[] args) {
    Integer []a={1,2,34,5,768,90};
    Alg <Integer> alg=new Alg<>();
        System.out.println(alg.FindMax(a));
    }
}
